package com.ycp.erp.login.activity;

import android.util.TypedValue;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.one.common.config.CMemoryData;
import com.one.common.config.RouterPath;
import com.one.common.manager.RouterManager;
import com.one.common.view.base.BaseActivity;
import com.one.common.view.widget.MyTitleBar;
import com.ycp.erp.R;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Class Des:
 * Created by bjh on 2021/8/23.
 */
public class LoginErpActivity extends BaseActivity {
    @BindView(R.id.vTop)
    View vTop;
    @BindView(R.id.tvS)
    TextView tvS;
    @BindView(R.id.tvLoginHint)
    TextView tvLoginHint;
    @BindView(R.id.tvAdministrator)
    TextView tvAdministrator;
    @BindView(R.id.vAdministrator)
    View vAdministrator;
    @BindView(R.id.llAdministrator)
    LinearLayout llAdministrator;
    @BindView(R.id.tvStaff)
    TextView tvStaff;
    @BindView(R.id.tvLogin)
    TextView tvLogin;
    @BindView(R.id.vStaff)
    View vStaff;
    @BindView(R.id.llStaff)
    LinearLayout llStaff;
    @BindView(R.id.ivLogin)
    ImageView ivLogin;
    @BindView(R.id.vLogin)
    View vLogin;
    @BindView(R.id.ivPsg)
    ImageView ivPsg;
    @BindView(R.id.vPsg)
    View vPsg;

    @Override
    protected void initPresenter() {

    }

    @Override
    public void initView() {
        super.initView();
        llAdministrator.performClick();
    }

    /**
     * 管理员
     */
    @OnClick(R.id.llAdministrator)
    public void changeToAdministrator(View view) {
        tvAdministrator.setTextColor(getResources().getColor(R.color.black));
        tvAdministrator.setTextSize(TypedValue.COMPLEX_UNIT_PX,getResources().getDimensionPixelSize(R.dimen.text_size18));
        vAdministrator.setVisibility(View.VISIBLE);
        tvStaff.setTextColor(getResources().getColor(R.color.text_color_66));
        tvStaff.setTextSize(TypedValue.COMPLEX_UNIT_PX,getResources().getDimensionPixelSize(R.dimen.text_size16));
        vStaff.setVisibility(View.INVISIBLE);
    }
    /**
     * 管理员
     */
    @OnClick(R.id.llStaff)
    public void changeToStaff(View view) {
        tvStaff.setTextColor(getResources().getColor(R.color.black));
        tvStaff.setTextSize(TypedValue.COMPLEX_UNIT_PX,getResources().getDimensionPixelSize(R.dimen.text_size18));
        vStaff.setVisibility(View.VISIBLE);
        tvAdministrator.setTextColor(getResources().getColor(R.color.text_color_66));
        tvAdministrator.setTextSize(TypedValue.COMPLEX_UNIT_PX,getResources().getDimensionPixelSize(R.dimen.text_size16));
        vAdministrator.setVisibility(View.INVISIBLE);
    }
    /**
     * 登录
     */
    @OnClick(R.id.tvLogin)
    public void login(View view) {
        CMemoryData.setIsLogin(true);
        RouterManager.getInstance().go(RouterPath.MAIN_PAGE);
//        finishPage();
    }
    @Override
    protected void initTitle() {
        super.initTitle();
        getMyTitleBar().setMode(MyTitleBar.Mode.BACK_TITLE)
                .setTitleText("登录").hideLine();
    }

    @Override
    public int getLayoutResId() {
        return R.layout.activity_login_erp;
    }
}
